import csv
from collections import defaultdict
csv_reader = csv.reader(open("data/耗材数据.csv"))
box = {}
bag = {}
for i, row in enumerate(csv_reader):
    if i!=0:
        name,type_,length,width,height = row
        length = int(length)
        width = int(width)
        height = int(height)
        if type_ == '袋':
            bag[name] = (length,width,height)
        else:
            box[name] = (length,width,height)
csv_reader = csv.reader(open("data/sku数据.csv",encoding='gbk'))
goods={}
for i, row in enumerate(csv_reader):
    if i!=0:
        sku,length,width,height,r = row[1:]
        sku = int(sku)
        length = int(length)
        width = int(width)
        height = int(height)
        r = int(r)
        goods[sku] = (length,width,height,r)
csv_reader = csv.reader(open("data/订单数据.csv",encoding='gbk'))
order = defaultdict(list)
for i,row in enumerate(csv_reader):
    if i!=0:
        order_id, sku, num = row[1:]
        order_id = int(order_id)
        sku = int(sku)
        num = int(num)
        order[order_id].append((sku,num))
print("data process over")